/**
 * 
 */
package dataTypes;

import java.util.ArrayList;

import dataTypes.environment.IntersectionPoint;

/**
 * @author Kevin Wagner
 * @version 1.0
 */
public class Environment {
	
	private ArrayList<IntersectionPoint> intersec=new ArrayList<IntersectionPoint>();
	private String name="";
	private int pop=0;
	
	/**
	 * @param name
	 */
	public Environment(){
	}

	/**
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name das zu setzende Objekt name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @param id id of the point
	 * @param x x-coordiante
	 * @param y y-coordinate
	 */
	public void addIntersectionPoint(long id, int x, int y){
		intersec.add(new IntersectionPoint(id, x, y));
	}
	
	/**
	 * 
	 * @return the intersection points of this environment
	 */
	public ArrayList<IntersectionPoint> getIntersectionPoints(){
		return intersec;
	}
	
	/**
	 * 
	 * @return the maximum id of an intersection point
	 */
	public long getMaxID(){
		long max=0;
		for(int i=0;i<intersec.size();i++){
			if(intersec.get(i).getId()>max){
				max=intersec.get(i).getId();
			}
		}
		return max;
	}

	/**
	 * @return the population
	 */
	public int getPopulation() {
		return pop;
	}

	/**
	 * @param pop new Population
	 */
	public void setPopulation(int pop) {
		this.pop = pop;
	}

}
